package com.zhoumin.demo.service.impl;

import com.zhoumin.demo.commons.PageParams;
import com.zhoumin.demo.commons.Pageable;
import com.zhoumin.demo.entity.Violation;
import com.zhoumin.demo.repository.ViolationMapper;
import com.zhoumin.demo.service.ViolationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ViolationServiceImpl implements ViolationService {

    @Resource
    private ViolationMapper violationMapper;

    //    根据摄像头地址和拍摄日期分页查询图片
    @Override
    public List<Violation> queryByKeyWords(PageParams pageParams) {
        Pageable pageable = pageParams.get();
//        取出前端传过来的年,月,日,拼接成time

//        将cameraAddress存到pageable对象中
        pageable.setCameraAddress(pageParams.getCameraAddress());
        List<Violation> violationList = violationMapper.queryByKeyWords(pageable);
        return null;
    }
}
